<?php
include_once '../dao/DbConfig.php';
$pro_id = $_GET['id'];
echo '<div id="featureCarousel">';
$check = '0';
$con = mysql_connect($dbConfig_hostName, $dbConfig_userName, $dbConfig_password);
if (!$con) {
    die('Could not connect: ' . mysql_error());
}
mysql_select_db($dbConfig_databaseName, $con);

$sql = "Select * from gallery where pro_id =" . $pro_id . " order by id ASC";
$result = mysql_query($sql);

while ($row = mysql_fetch_array($result)) {
    $id[] = $row['id'];
    $image[] = $row['gal_image'];
    if ($check == 0) {
        $descript = $row['gal_description'];
    }
    $check = 1;
}
mysql_close($con);
if ($check == 1) {
    $i = 0;
    $count_id = count($id);
    while ($i < $count_id) {
        echo '<div class="feature">
                        <a href="#"><img alt="" src="../uploads/gallery/' . $image[$i] . '"/></a>
                    </div>';
        ++$i;
    }
    echo '</div><div class="pro_descript">
                <p>' . $descript . '</p>
            </div>';
} else {
    echo  '<div class="feature">
                            <a href="#"><img alt="No_Photo" src="../uploads/gallery/no_photo.jpg"/></a>
                        </div><div class="feature">
                            <a href="#"><img alt="No_Photo" src="../uploads/gallery/no_photo.jpg"/></a>
                        </div><div class="feature">
                            <a href="#"><img alt="No_Photo" src="../uploads/gallery/no_photo.jpg"/></a>
                        </div>
                        </div>
                        <div class="pro_descript">
                            <p></p>
                        </div>';
}
?>